﻿using Microsoft.EntityFrameworkCore;
using SqliteDAL.Model;

namespace SqliteDAL
{
    public class MyContext : DbContext
    {
        public virtual DbSet<Samples> Samples { get; set; }
        public virtual DbSet<Incubates> Incubates { get; set; }
        public virtual DbSet<Reagents> Reagents { get; set; }
        public virtual DbSet<SuctionHeads> SuctionHeads { get; set; }
        public virtual DbSet<WashBoards> WashBoards { get; set; }
        public virtual DbSet<CoverPlates> CoverPlates { get; set; }
        public virtual DbSet<DataDictinarys> DataDictinarys { get; set; }
        public virtual DbSet<Microcoders> Microcoders { get; set; }
        public virtual DbSet<Projects> Projects { get; set; }



        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //string conn = ConfigurationHelper.GetConnectionString("ConnectionString", "config.json");
            string conn = "Data Source=config.db";
            optionsBuilder.UseSqlite(conn);
            base.OnConfiguring(optionsBuilder);
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.ApplyConfigurationsFromAssembly(this.GetType().Assembly);
        }
    }
}
